
/* Otto DIY Web 控制台 - 移动端优化样式 */

/* 移动端导航优化 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        margin: 0.25rem 0;
        transition: background-color 0.2s ease;
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* 移动端状态卡片优化 */
@media (max-width: 576px) {
    .status-card {
        margin-bottom: 0.75rem;
    }
    
    .status-card .card-body {
        padding: 1rem;
    }
    
    .status-card h3 {
        font-size: 1.5rem;
        margin: 0.25rem 0;
    }
    
    .status-card i {
        font-size: 1.5rem !important;
    }
    
    /* 状态卡片网格布局 */
    .row > [class*="col-"] {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
}

/* 移动端控制面板优化 */
@media (max-width: 576px) {
    .control-pad {
        padding: 0.5rem;
    }
    
    .btn-control {
        width: 55px;
        height: 55px;
        font-size: 1.1rem;
        margin: 3px;
    }
    
    /* 控制按钮触摸优化 */
    .btn-control {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-control:active {
        transform: scale(0.95);
    }
}

/* 移动端动作按钮优化 */
@media (max-width: 576px) {
    .btn-action {
        padding: 0.6rem;
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .btn-group-custom {
        gap: 0.25rem;
    }
    
    .btn-group-custom .btn {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
    }
}

/* 移动端表单优化 */
@media (max-width: 576px) {
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem 1rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 表单按钮优化 */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px; /* 触摸目标最小尺寸 */
    }
}

/* 移动端卡片布局优化 */
@media (max-width: 576px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* 减少卡片阴影 */
    .card {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
}

/* 移动端舞步列表优化 */
@media (max-width: 576px) {
    .dance-item {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .dance-item .dance-name {
        font-size: 0.9rem;
    }
    
    .dance-item .dance-info {
        font-size: 0.8rem;
    }
    
    /* 舞步操作按钮优化 */
    .dance-item .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .dance-item .btn-group {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* 移动端模态框优化 */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* 移动端Toast提示优化 */
@media (max-width: 576px) {
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
        padding: 0;
    }
    
    .toast {
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }
    
    .toast-header {
        padding: 0.75rem 1rem;
    }
    
    .toast-body {
        padding: 1rem;
    }
}

/* 移动端文件上传优化 */
@media (max-width: 576px) {
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-area i {
        font-size: 2rem;
    }
    
    .upload-area p {
        font-size: 0.9rem;
    }
}

/* 移动端滚动优化 */
@media (max-width: 576px) {
    .dance-list {
        max-height: 300px;
    }
    
    /* 自定义滚动条移动端优化 */
    .dance-list::-webkit-scrollbar {
        width: 4px;
    }
    
    .dance-list::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .status-card {
        margin-bottom: 0.5rem;
    }
    
    .status-card .card-body {
        padding: 0.75rem;
    }
    
    .btn-control {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .control-pad {
        padding: 0.25rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    .status-card:hover {
        transform: none;
    }
    
    /* 增加触摸目标 */
    .btn,
    .form-control,
    .form-check-input,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 暗色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #ffffff;
    }
    
    .card {
        background-color: #1e1e1e;
        color: #ffffff;
    }
    
    .card-header {
        background-color: #2d2d2d;
        border-bottom-color: #3d3d3d;
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #3d3d3d;
        color: #ffffff;
    }
    
    .form-control:focus {
        background-color: #2d2d2d;
        border-color: var(--primary-color);
        color: #ffffff;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .status-updating {
        animation: none;
    }
    
    .loading {
        animation: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }
    
    .form-control {
        border-width: 2px;
    }
    
    .card {
        border: 2px solid #000;
    }
}

/* 移动端网络状态指示器 */
.connection-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--success-color);
    z-index: 1050;
    transition: all 0.3s ease;
}

.connection-indicator.disconnected {
    background-color: var(--danger-color);
    height: 4px;
}

.connection-indicator.connecting {
    background-color: var(--warning-color);
    height: 4px;
    animation: pulse 1.5s infinite;
}

/* 移动端加载状态 */
.mobile-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1060;
}

/* 移动端离线提示 */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--warning-color);
    color: #000;
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
    z-index: 105